class Solution:
    # @param version1, a string
    # @param version2, a string
    # @return an integer
    def compareVersion(self, version1, version2):
    	l1 = version1.split('.')
    	l2 = version2.split('.')
    	for i in xrange(max(len(l1),len(l2))):
    		if i > len(l1)-1:
    			a = 0
    		else:
    			a = int(l1[i])
    		if i > len(l2)-1:
    			b = 0
    		else:
    			b = int(l2[i])
    		if a < b:
    			return -1
    		elif a > b:
    			return 1
    	return 0

if __name__ == '__main__':
 	so = Solution()
 	print(so.compareVersion("01.2.1.0", "1.2.1")) 